<script type="text/javascript">
/*----------------------------------------------------------
 EVENT
-----------------------------------------------------------*/
$('#btn-add').click(function(){
   var dupplidateInfo = $('#tpl_info').html();
   var maxIndex =$('.info').length - 1;
   
   $('.control').before(dupplidateInfo.replace(/\{x\}/g, maxIndex));
});

$('#btn-reset').click(function(){
    window.location.reload();
});

$('.btn-cancel').click(function(){
  window.location = '<?php echo $this->createUrl('index'); ?>';
})

$(document).on('click', '.btn-remove', function(){
   $(this).parents('.info').remove();
});

/*----------------------------------------------------------
PROCESSING
 ----------------------------------------------------------*/

</script>